<template>
  <div id="app">
    <div>
      <v-head></v-head>
      <div class="container-fluid">
        <div class="row">
          <v-aside></v-aside>
          <router-view :students="students" :infos="infos" :studentHistorys="studentHistorys" />
          <h3></h3>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import header from "./components/header/header";
import aside from "./components/header/aside";

export default {
  data() {
    return {
      students: {},
      infos: {},
      studentHistorys: {},
      showIndex: false
    };
  },
  components: {
    "v-head": header,
    "v-aside": aside
  },
  methods: {
    getStudents() {
      this.$http.get("/students").then(response => {
        this.students = response.body;
      });
    },
    getInfos() {
      this.$http.get("/msg").then(response => {
        this.infos = response.body;
      });
    },
    getStudentsHistory() {
      this.$http.get("/history").then(response => {
        this.studentHistorys = response.body;
      });
    },
    getData() {
      this.getInfos();
      this.getStudents();
      this.getStudentsHistory();
    }
  },
  created() {
    this.getData();
  }
};
</script>
<style>
.login {
  width: 500px;
  margin: 0 auto;
}
</style>



